<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    div {
      margin: 200px;
    }

    span {
      display: inline-block;
      width: 40px;
      height: 40px;
      background-color: #333;
      font-size: 20px;
      color: #fff;
      text-align: center;
      line-height: 40px;
    }
  </style>
</head>
<body>
<div>
  <span class="hour">1</span>
  <span class="minute">2</span>
  <span class="second">3</span>
</div>
<script>
  var hour = document.querySelector('.hour');
  var minute = document.querySelector('.minute');
  var second = document.querySelector('.second')

  countDown();
  window.setInterval(countDown, 1000);





  function countDown() {
    var nowTime = +new Date();
    var endTime = +new Date('2020-10-10 22:20:00');
    var time = (endTime - nowTime) / 1000;

    hour.innerHTML = parseInt(time / 60 / 60 % 24);
    minute.innerHTML = parseInt(time / 60 % 60);
    second.innerHTML = parseInt(time % 60);

  }

  countDown(time);
</script>
</body>
</html>